import { defHttp } from "@/utils/http";

// ERP 销售比例分组 VO
export interface SrGrpVO {
	groupId: number; // 主键,示例值(16472)
	minValue: number; //最小值
	maxValue: number; // 最大值
	ratio: number; // 比例值
	userId: number; // 用户ID
}

// ERP 销售比例分组 API
export const SrGrpApi = {
	// 查询销售比例分组分页
	getSrGrpPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/ratio-grouping-record/page`, params });
	},

	// 查询销售比例分组详情
	getSrGrp: async (id: number) => {
		return await defHttp.get({ url: `/whs/ratio-grouping-record/get?id=` + id });
	},

	// 新增销售比例分组
	createSrGrp: async (data: SrGrpVO) => {
		return await defHttp.post({ url: `/whs/ratio-grouping-record/create`, data });
	},

	// 修改销售比例分组
	updateSrGrp: async (data: SrGrpVO) => {
		return await defHttp.put({ url: `/whs/ratio-grouping-record/update`, data });
	},

	// 删除销售比例分组
	deleteSrGrp: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/ratio-grouping-record/delete?id=` + id
		});
	},

	// 导出销售比例分组 Excel
	exportSrGrp: async (params: any) => {
		return await defHttp.download({ url: `/whs/ratio-grouping-record/export-excel`, params });
	}
};
